#coding=utf-8
#绑定实例
class student(object):
    pass
def set_age(self,age):
    self.age=age
def set_score(self,score):
    self.score=score
s=student()
from types import MethodType
s.set_age=MethodType(set_age,s,student)
s.set_age(100)
print s.age
s1=student()
student.set_score=MethodType(set_score,None,student)
s1.set_score(100)
print s1.score
